using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using Fasm;
using GreyMagic;
using log4net;
using ns24;
using Triton.Common.LogUtilities;

namespace Triton.Game
{
	public static class ProcessHookManager
	{
		public enum StateEnum
		{
			None,
			Enabled,
			Disabled
		}

		private class Class243 : IEquatable<Class243>
		{
			public int int_0;

			public List<byte[]> list_0;

			public string ToString()
			{
				return $"Pid: {int_0}";
			}

			public bool Equals(Class243 other)
			{
				if ((object)other == null)
				{
					return false;
				}
				if ((object)this == other)
				{
					return true;
				}
				return int_0 == other.int_0;
			}

			public bool Equals(object obj)
			{
				if (obj == null)
				{
					return false;
				}
				if (this == obj)
				{
					return true;
				}
				if (obj.GetType() != GetType())
				{
					return false;
				}
				return Equals((Class243)obj);
			}

			public virtual int GetHashCode()
			{
				return int_0;
			}

			public static bool operator ==(Class243 left, Class243 right)
			{
				return object.Equals(left, right);
			}

			public static bool operator !=(Class243 left, Class243 right)
			{
				return !object.Equals(left, right);
			}
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class Class244
		{
			public static readonly Class244 Instance9 = new Class244();

			public static Func<Class243, bool> Instance9__35_0;

			public static Func<Class243, bool> Instance9__36_0;

			internal bool method_0(Class243 class243_0)
			{
				return class243_0.int_0 == ExternalProcessMemory_0.Process.Id;
			}

			internal bool method_1(Class243 class243_0)
			{
				return class243_0.int_0 == ExternalProcessMemory_0.Process.Id;
			}
		}

		private static readonly ILog ilog_0 = Logger.GetLoggerInstanceForType();

		private static string[] string_0 = new string[1] { "PatchTrack.dat" };

		private static AllocatedMemory allocatedMemory_0;

		[CompilerGenerated]
		private static StateEnum stateEnum_0;

		private static int int_0;

		private static int int_1;

		private static int int_2;

		private static int int_3;

		private static int int_4;

		private static int int_5;

		private static int int_6;

		private static byte[] byte_0;

		private static IntPtr intptr_0;

		private static byte[] byte_1;

		private static IntPtr intptr_1;

		private static byte[] byte_2;

		private static IntPtr intptr_2;

		private static byte[] byte_3;

		private static IntPtr intptr_3;

		private static byte[] byte_4;

		private static IntPtr intptr_4;

		private static readonly byte[] byte_5 = new byte[1024];

		private static string String_0 => $"PatchTrack_v2_{1}{1}{0}{1}{1}{1}{0}";

		private static ExternalProcessMemory ExternalProcessMemory_0 => TritonHs.Memory;

		private static IntPtr IntPtr_0 => TritonHs.ClientWindowHandle;

		public static WindowInfoWin32 WindowInfo
		{
			get
			{
				WindowInfoWin32 windowInfoWin = default(WindowInfoWin32);
				windowInfoWin.Size = (uint)MarshalCache<WindowInfoWin32>.Size;
				WindowInfoWin32 pwi = windowInfoWin;
				Interop.GetWindowInfo(IntPtr_0, ref pwi);
				return pwi;
			}
		}

		public static StateEnum State
		{
			[CompilerGenerated]
			get
			{
				return stateEnum_0;
			}
			[CompilerGenerated]
			private set
			{
				stateEnum_0 = value;
			}
		}

		public static bool IsEnabled => State == StateEnum.Enabled;

		private static List<Class243> smethod_0()
		{
			List<Class243> list = new List<Class243>();
			if (File.Exists(String_0))
			{
				using (BinaryReader binaryReader = new BinaryReader(File.OpenRead(String_0)))
				{
					int num = binaryReader.ReadInt32();
					for (int i = 0; i < num; i++)
					{
						int num2 = binaryReader.ReadInt32();
						int num3 = binaryReader.ReadInt32();
						List<byte[]> list2 = new List<byte[]>();
						for (int j = 0; j < num3; j++)
						{
							int count = binaryReader.ReadInt32();
							list2.Add(binaryReader.ReadBytes(count));
						}
						list.Add(new Class243
						{
							int_0 = num2,
							list_0 = list2
						});
					}
					return list;
				}
			}
			return list;
		}

		private static List<byte[]> smethod_1()
		{
			List<Class243> list = smethod_0();
			if (list.Count == 0)
			{
				return null;
			}
			Class243 @class = list.FirstOrDefault((Class243 class243_0) => class243_0.int_0 == ExternalProcessMemory_0.Process.Id);
			if (@class != null)
			{
				return @class.list_0;
			}
			return null;
		}

		private static void smethod_2()
		{
			List<Class243> list = smethod_0();
			if (list.Any((Class243 class243_0) => class243_0.int_0 == ExternalProcessMemory_0.Process.Id))
			{
				return;
			}
			Class243 @class = new Class243
			{
				int_0 = ExternalProcessMemory_0.Process.Id,
				list_0 = new List<byte[]>()
			};
			ExternalProcessMemory externalProcessMemory_ = ExternalProcessMemory_0;
			using (TritonHs.AcquireFrame())
			{
				@class.list_0.Add(externalProcessMemory_.Patches["ProcessHookManager_GetForegroundWindow"].OriginalBytes);
				@class.list_0.Add(externalProcessMemory_.Patches["ProcessHookManager_GetActiveWindow"].OriginalBytes);
				@class.list_0.Add(externalProcessMemory_.Patches["ProcessHookManager_GetKeyState"].OriginalBytes);
				@class.list_0.Add(externalProcessMemory_.Patches["ProcessHookManager_GetCursorPos"].OriginalBytes);
				@class.list_0.Add(externalProcessMemory_.Patches["ProcessHookManager_ScreenToClient"].OriginalBytes);
			}
			list.Add(@class);
			Class243[] array = list.ToArray();
			foreach (Class243 class2 in array)
			{
				try
				{
					Process processById = Process.GetProcessById(class2.int_0);
					try
					{
						if (!processById.ProcessName.ToLowerInvariant().Contains("hearthstone"))
						{
							list.Remove(class2);
						}
					}
					catch
					{
						list.Remove(class2);
					}
				}
				catch (ArgumentException)
				{
					list.Remove(class2);
				}
			}
			using FileStream output = File.Create(String_0);
			using BinaryWriter binaryWriter = new BinaryWriter(output);
			binaryWriter.Write(list.Count);
			foreach (Class243 item in list)
			{
				binaryWriter.Write(item.int_0);
				binaryWriter.Write(item.list_0.Count);
				foreach (byte[] item2 in item.list_0)
				{
					binaryWriter.Write(item2.Length);
					binaryWriter.Write(item2);
				}
			}
		}

		internal static void smethod_3()
		{
			State = StateEnum.None;
			string[] array = string_0;
			foreach (string path in array)
			{
				try
				{
					File.Delete(path);
				}
				catch
				{
				}
			}
			ExternalProcessMemory externalProcessMemory_ = ExternalProcessMemory_0;
			intptr_1 = externalProcessMemory_.GetProcAddress("user32.dll", "GetActiveWindow");
			if (intptr_1 == IntPtr.Zero)
			{
				throw new Exception("The function 'GetActiveWindow' was not found.");
			}
			intptr_0 = externalProcessMemory_.GetProcAddress("user32.dll", "GetForegroundWindow");
			if (intptr_0 == IntPtr.Zero)
			{
				throw new Exception("The function 'GetForegroundWindow' was not found.");
			}
			intptr_2 = externalProcessMemory_.GetProcAddress("user32.dll", "GetKeyState");
			if (intptr_2 == IntPtr.Zero)
			{
				throw new Exception("The function 'GetKeyState' was not found.");
			}
			intptr_3 = externalProcessMemory_.GetProcAddress("user32.dll", "GetCursorPos");
			if (intptr_3 == IntPtr.Zero)
			{
				throw new Exception("The function 'GetCursorPos' was not found.");
			}
			intptr_4 = externalProcessMemory_.GetProcAddress("user32.dll", "ScreenToClient");
			if (intptr_4 == IntPtr.Zero)
			{
				throw new Exception("The function 'ScreenToClient' was not found.");
			}
			allocatedMemory_0 = externalProcessMemory_.CreateAllocatedMemory(4096);
			List<byte[]> list = smethod_1();
			if (list != null)
			{
				using (TritonHs.AcquireFrame())
				{
					ExternalProcessMemory_0.WriteBytes(intptr_0, list[0]);
					ExternalProcessMemory_0.WriteBytes(intptr_1, list[1]);
					ExternalProcessMemory_0.WriteBytes(intptr_2, list[2]);
					ExternalProcessMemory_0.WriteBytes(intptr_3, list[3]);
					ExternalProcessMemory_0.WriteBytes(intptr_4, list[4]);
				}
			}
			bool flag = false;
			try
			{
				int num = 0;
				IntPtr intPtr_ = IntPtr_0;
				ManagedFasm asm = externalProcessMemory_.Asm;
				asm.Clear();
				asm.smethod_3("mov eax, " + intPtr_);
				asm.smethod_3("retn");
				byte[] array2 = asm.Assemble();
				asm.Clear();
				allocatedMemory_0.WriteBytes(0, array2);
				int value = (allocatedMemory_0.Address + 0).ToInt32() - intptr_0.ToInt32() - 5;
				int value2 = (allocatedMemory_0.Address + 0).ToInt32() - intptr_1.ToInt32() - 5;
				num = 0 + array2.Length;
				byte_0 = new byte[5];
				byte_0[0] = 233;
				byte[] bytes = BitConverter.GetBytes(value);
				for (int j = 0; j < bytes.Length; j++)
				{
					byte_0[j + 1] = bytes[j];
				}
				byte_1 = new byte[5];
				byte_1[0] = 233;
				byte[] bytes2 = BitConverter.GetBytes(value2);
				for (int k = 0; k < bytes2.Length; k++)
				{
					byte_1[k + 1] = bytes2[k];
				}
				externalProcessMemory_.Patches.Create(intptr_0, byte_0, "ProcessHookManager_GetForegroundWindow");
				externalProcessMemory_.Patches.Create(intptr_1, byte_1, "ProcessHookManager_GetActiveWindow");
				byte[] bytes3 = new byte[1024];
				allocatedMemory_0.WriteBytes(num, bytes3);
				IntPtr intPtr = allocatedMemory_0.Address + num;
				int_0 = num;
				num += 1024;
				byte[] bytes4 = new byte[8];
				allocatedMemory_0.WriteBytes(num, bytes4);
				IntPtr intPtr2 = allocatedMemory_0.Address + num;
				num += 4;
				IntPtr intPtr3 = allocatedMemory_0.Address + num;
				num += 4;
				ManagedFasm asm2 = externalProcessMemory_.Asm;
				asm2.Clear();
				asm2.smethod_3("pop eax");
				asm2.smethod_4("mov [{0}], eax", intPtr2);
				asm2.smethod_3("pop eax");
				asm2.smethod_4("mov [{0}], eax", intPtr3);
				asm2.smethod_3("imul eax, 4");
				asm2.smethod_4("add eax, {0}", intPtr);
				asm2.smethod_3("mov eax, [eax]");
				asm2.smethod_4("pushd [{0}]", intPtr2);
				asm2.smethod_3("retn");
				byte[] array3 = asm2.Assemble();
				asm2.Clear();
				allocatedMemory_0.WriteBytes(num, array3);
				int value3 = (allocatedMemory_0.Address + num).ToInt32() - intptr_2.ToInt32() - 5;
				num += array3.Length;
				byte_2 = new byte[5];
				byte_2[0] = 233;
				byte[] bytes5 = BitConverter.GetBytes(value3);
				for (int l = 0; l < bytes5.Length; l++)
				{
					byte_2[l + 1] = bytes5[l];
				}
				externalProcessMemory_.Patches.Create(intptr_2, byte_2, "ProcessHookManager_GetKeyState");
				byte[] bytes6 = new byte[12]
				{
					0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
					0, 0
				};
				allocatedMemory_0.WriteBytes(num, bytes6);
				IntPtr intPtr4 = allocatedMemory_0.Address + num;
				int_1 = num;
				num = (int_3 = (int_2 = num + 4) + 4) + 4;
				byte[] bytes7 = new byte[8];
				allocatedMemory_0.WriteBytes(num, bytes7);
				IntPtr intPtr5 = allocatedMemory_0.Address + num;
				num += 4;
				IntPtr intPtr6 = allocatedMemory_0.Address + num;
				num += 4;
				ManagedFasm asm3 = externalProcessMemory_.Asm;
				asm3.Clear();
				asm3.smethod_3("pop eax");
				asm3.smethod_4("mov [{0}], eax", intPtr5);
				asm3.smethod_3("pop eax");
				asm3.smethod_4("mov [{0}], eax", intPtr6);
				asm3.smethod_3("push ecx");
				asm3.smethod_4("mov ecx, {0}", intPtr4);
				asm3.smethod_3("mov ecx, [ecx]");
				asm3.smethod_3("mov [eax], ecx");
				asm3.smethod_3("add eax, 4");
				asm3.smethod_4("mov ecx, {0}", intPtr4);
				asm3.smethod_3("add ecx, 4");
				asm3.smethod_3("mov ecx, [ecx]");
				asm3.smethod_3("mov [eax], ecx");
				asm3.smethod_4("mov ecx, {0}", intPtr4);
				asm3.smethod_3("add ecx, 8");
				asm3.smethod_3("mov eax, [ecx]");
				asm3.smethod_3("pop ecx");
				asm3.smethod_4("pushd [{0}]", intPtr5);
				asm3.smethod_3("retn");
				byte[] array4 = asm3.Assemble();
				asm3.Clear();
				allocatedMemory_0.WriteBytes(num, array4);
				int value4 = (allocatedMemory_0.Address + num).ToInt32() - intptr_3.ToInt32() - 5;
				num += array4.Length;
				byte_3 = new byte[5];
				byte_3[0] = 233;
				byte[] bytes8 = BitConverter.GetBytes(value4);
				for (int m = 0; m < bytes8.Length; m++)
				{
					byte_3[m + 1] = bytes8[m];
				}
				externalProcessMemory_.Patches.Create(intptr_3, byte_3, "ProcessHookManager_GetCursorPos");
				byte[] bytes9 = new byte[12]
				{
					0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
					0, 0
				};
				allocatedMemory_0.WriteBytes(num, bytes9);
				IntPtr intPtr7 = allocatedMemory_0.Address + num;
				int_4 = num;
				num = (int_6 = (int_5 = num + 4) + 4) + 4;
				byte[] bytes10 = new byte[12];
				allocatedMemory_0.WriteBytes(num, bytes10);
				IntPtr intPtr8 = allocatedMemory_0.Address + num;
				num += 4;
				IntPtr intPtr9 = allocatedMemory_0.Address + num;
				num += 4;
				IntPtr intPtr10 = allocatedMemory_0.Address + num;
				num += 4;
				ManagedFasm asm4 = externalProcessMemory_.Asm;
				asm4.Clear();
				asm4.smethod_3("pop eax");
				asm4.smethod_4("mov [{0}], eax", intPtr8);
				asm4.smethod_3("pop eax");
				asm4.smethod_4("mov [{0}], eax", intPtr9);
				asm4.smethod_3("pop eax");
				asm4.smethod_4("mov [{0}], eax", intPtr10);
				asm4.smethod_3("push ecx");
				asm4.smethod_4("mov ecx, {0}", intPtr7);
				asm4.smethod_3("mov ecx, [ecx]");
				asm4.smethod_3("mov [eax], ecx");
				asm4.smethod_3("add eax, 4");
				asm4.smethod_4("mov ecx, {0}", intPtr7);
				asm4.smethod_3("add ecx, 4");
				asm4.smethod_3("mov ecx, [ecx]");
				asm4.smethod_3("mov [eax], ecx");
				asm4.smethod_4("mov ecx, {0}", intPtr7);
				asm4.smethod_3("add ecx, 8");
				asm4.smethod_3("mov eax, [ecx]");
				asm4.smethod_3("pop ecx");
				asm4.smethod_4("pushd [{0}]", intPtr8);
				asm4.smethod_3("retn");
				byte[] array5 = asm4.Assemble();
				asm4.Clear();
				allocatedMemory_0.WriteBytes(num, array5);
				int value5 = (allocatedMemory_0.Address + num).ToInt32() - intptr_4.ToInt32() - 5;
				num += array5.Length;
				byte_4 = new byte[5];
				byte_4[0] = 233;
				byte[] bytes11 = BitConverter.GetBytes(value5);
				for (int n = 0; n < bytes11.Length; n++)
				{
					byte_4[n + 1] = bytes11[n];
				}
				externalProcessMemory_.Patches.Create(intptr_4, byte_4, "ProcessHookManager_ScreenToClient");
				smethod_2();
			}
			catch (Exception)
			{
				flag = true;
				throw;
			}
			finally
			{
				if (flag && allocatedMemory_0 != null)
				{
					allocatedMemory_0.Dispose();
					allocatedMemory_0 = null;
				}
			}
		}

		public static void Enable()
		{
			if (State != StateEnum.Enabled && ExternalProcessMemory_0 != null)
			{
				using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
				{
					ExternalProcessMemory_0.Patches["ProcessHookManager_GetForegroundWindow"].Apply();
					ExternalProcessMemory_0.Patches["ProcessHookManager_GetActiveWindow"].Apply();
					ExternalProcessMemory_0.Patches["ProcessHookManager_GetKeyState"].Apply();
					ExternalProcessMemory_0.Patches["ProcessHookManager_GetCursorPos"].Apply();
					ExternalProcessMemory_0.Patches["ProcessHookManager_ScreenToClient"].Apply();
					State = StateEnum.Enabled;
					Reset();
				}
			}
		}

		public static void Disable()
		{
			if (State == StateEnum.Enabled && ExternalProcessMemory_0 != null)
			{
				Reset();
				using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
				{
					ExternalProcessMemory_0.Patches["ProcessHookManager_GetForegroundWindow"].Remove();
					ExternalProcessMemory_0.Patches["ProcessHookManager_GetActiveWindow"].Remove();
					ExternalProcessMemory_0.Patches["ProcessHookManager_GetKeyState"].Remove();
					ExternalProcessMemory_0.Patches["ProcessHookManager_GetCursorPos"].Remove();
					ExternalProcessMemory_0.Patches["ProcessHookManager_ScreenToClient"].Remove();
					State = StateEnum.Disabled;
				}
			}
		}

		internal static void smethod_4()
		{
			Disable();
			if (ExternalProcessMemory_0 != null)
			{
				using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
				{
					ExternalProcessMemory_0.Patches.Delete("ProcessHookManager_GetForegroundWindow");
					ExternalProcessMemory_0.Patches.Delete("ProcessHookManager_GetActiveWindow");
					ExternalProcessMemory_0.Patches.Delete("ProcessHookManager_GetKeyState");
					ExternalProcessMemory_0.Patches.Delete("ProcessHookManager_GetCursorPos");
					ExternalProcessMemory_0.Patches.Delete("ProcessHookManager_ScreenToClient");
				}
			}
			if (allocatedMemory_0 != null)
			{
				allocatedMemory_0.Dispose();
				allocatedMemory_0 = null;
			}
		}

		public static void SetKeyState(Keys key, int value)
		{
			if (key >= Keys.None && key <= (Keys.F16 | Keys.F17))
			{
				Verify();
				using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
				{
					allocatedMemory_0.Write(int_0 + (int)key * 4, value);
				}
			}
			else
			{
				ilog_0.ErrorFormat("[SetKeyState] The key {0} is unsupported.", key);
			}
		}

		public static int GetKeyState(Keys key)
		{
			if (key >= Keys.None && key <= (Keys.F16 | Keys.F17))
			{
				Verify();
				using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
				{
					return allocatedMemory_0.Read<int>(int_0 + (int)key * 4);
				}
			}
			ilog_0.ErrorFormat("[SetKeyState] The key {0} is unsupported.", key);
			return 0;
		}

		public static bool IsKeyDown(Keys key)
		{
			return (GetKeyState(key) & 0x8000) != 0;
		}

		public static void SetCursorPos(int x, int y, int result = 1)
		{
			Verify();
			using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
			{
				allocatedMemory_0.Write(int_1, x);
				allocatedMemory_0.Write(int_2, y);
				allocatedMemory_0.Write(int_3, result);
			}
		}

		public static void ReadCursorPos(out int x, out int y, out int result)
		{
			Verify();
			using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
			{
				x = allocatedMemory_0.Read<int>(int_1);
				y = allocatedMemory_0.Read<int>(int_2);
				result = allocatedMemory_0.Read<int>(int_3);
			}
		}

		public static void ScreenToClient(int x, int y, int result = 1)
		{
			Verify();
			using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
			{
				allocatedMemory_0.Write(int_4, x);
				allocatedMemory_0.Write(int_5, y);
				allocatedMemory_0.Write(int_6, result);
			}
		}

		public static void ReadScreenToClient(out int x, out int y, out int result)
		{
			using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
			{
				x = allocatedMemory_0.Read<int>(int_4);
				y = allocatedMemory_0.Read<int>(int_5);
				result = allocatedMemory_0.Read<int>(int_6);
			}
		}

		public static void ResetCursor()
		{
			WindowInfoWin32 windowInfo = WindowInfo;
			int x = windowInfo.Window.Left + (windowInfo.Window.Right - windowInfo.Window.Left) / 2;
			int y = windowInfo.Window.Top + (windowInfo.Window.Bottom - windowInfo.Window.Top) / 2;
			int x2 = (windowInfo.Client.Right - windowInfo.Client.Left) / 2;
			int y2 = (windowInfo.Client.Bottom - windowInfo.Client.Top) / 2;
			SetCursorPos(x, y);
			ScreenToClient(x2, y2);
		}

		public static void ResetKeyStates()
		{
			Verify();
			using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
			{
				allocatedMemory_0.WriteBytes(int_0, byte_5);
			}
		}

		public static void Reset()
		{
			ResetCursor();
			ResetKeyStates();
		}

		public static bool Verify()
		{
			using (ExternalProcessMemory_0.TemporaryCacheState(enabledTemporarily: false))
			{
				if (!IsEnabled)
				{
					ilog_0.ErrorFormat("[Verify] !IsEnabled.");
					return false;
				}
				byte[] array = ExternalProcessMemory_0.ReadBytes(intptr_1, 5);
				byte[] array2 = ExternalProcessMemory_0.ReadBytes(intptr_0, 5);
				byte[] array3 = ExternalProcessMemory_0.ReadBytes(intptr_2, 5);
				byte[] array4 = ExternalProcessMemory_0.ReadBytes(intptr_3, 5);
				byte[] array5 = ExternalProcessMemory_0.ReadBytes(intptr_4, 5);
				bool flag = false;
				for (int i = 0; i < 5; i++)
				{
					if (byte_0[i] != array2[i])
					{
						flag = true;
						ilog_0.ErrorFormat("[Verify] Verification failed for function #1. This will directly affect the bot.");
						break;
					}
				}
				for (int j = 0; j < 5; j++)
				{
					if (byte_1[j] != array[j])
					{
						flag = true;
						ilog_0.ErrorFormat("[Verify] Verification failed for function #2. This will directly affect the bot.");
						break;
					}
				}
				for (int k = 0; k < 5; k++)
				{
					if (byte_2[k] != array3[k])
					{
						flag = true;
						ilog_0.ErrorFormat("[Verify] Verification failed for function #4. This will directly affect the bot.");
						break;
					}
				}
				for (int l = 0; l < 5; l++)
				{
					if (byte_3[l] != array4[l])
					{
						flag = true;
						ilog_0.ErrorFormat("[Verify] Verification failed for function #5. This will directly affect the bot.");
						break;
					}
				}
				for (int m = 0; m < 5; m++)
				{
					if (byte_4[m] != array5[m])
					{
						flag = true;
						ilog_0.ErrorFormat("[Verify] Verification failed for function #6. This will directly affect the bot.");
						break;
					}
				}
				return !flag;
			}
		}
	}
}
